<?php
include_once ("../Class/Privilegis.class.php");
include_once ("../Class/Perfils.class.php");
	
	$Privi=new Privilegis();
	$Perf= new PerfilsDAO();
	if(isset($_POST['nom_perfil'])){
		
		$Perf->crearTipusPerfil($_POST['nom_perfil']);
}

	
	

	$recordSet1=$Perf->LlistarTipusPerfils();
	$recordSet2=$Privi->llistarPrivilegis();
?>
<html>
	<head>
	</head>
	<body>
		<Form name="Form_Crea_perfils"  method="post" action="./CrearPerfil.php">
		<Strong>Nom Perfil</Strong><br>
		<input type="text" value="" name="nom_perfil" id="nom_perfil" maxlength="30">
		<BR>
		<Strong>Modifica Perfil Existent</Strong><br>
		<BR>
		<select name="TipusPerfils" id="TipusPerfils">
		<?
			while ($arr_resul= mysql_fetch_assoc($recordSet1)){
				$nom=$arr_resul['nom'];
				echo "<option value=\".$nom.\">".$nom."</option> ";
				echo "</BR>";
				echo "<BR>";
				echo "<BR>";
			}
		?>
		</select>
		<BR>
		</BR>
		<?
			while ($arr_resul= mysql_fetch_assoc($recordSet2)){
				$nom=$arr_resul['nom'];
				$numero++;
				print ("<input type='CheckBox' name='".$nom."'  maxlength='30'>".$nom."<br>");
				echo "</BR>";
			}
	?>
		
		<input type="submit" name="boton" value="enviar">
		</Form>
	
	</body>
</html>
